﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Xml;
using System.IO;

public class KanbanConfigRepository
{
    private const string KanbanConfigsFileName = "KanbanConfigs.xml";

    private XmlDocument _configXml = new XmlDocument();

    public KanbanConfig this[string configName]
    {
        get
        {
            return new KanbanConfig(_configXml.SelectSingleNode(string.Format("//KanbanConfigs/KanbanConfig[@Name='{0}']", configName)));
        }
    }

    public KanbanConfigRepository()
    {
        string configFilePath = Path.Combine(HttpContext.Current.Request.PhysicalApplicationPath, KanbanConfigsFileName);
        _configXml.Load(configFilePath);
    }
}
